package com.mathdemo;

public class MathTest1 {
    public static void main(String[] args) {
        //判断一个数字是否为素数
        System.out.println(isPrime(13));
        System.out.println(isPrime(16));
        //997
        System.out.println(isPrime(997));
    }
    public static boolean isPrime(int number){
        for (int i = 2; i <=Math.sqrt(number); i++) {
            if(number%i==0){
                return false;
            }
        }
        return true;
    }
}
